<template>
  <div class="subject-test">
    <van-sticky>
    <van-nav-bar placeholder z-index="1000"  left-arrow>
      <template #title>
        <van-dropdown-menu active-color="#171A1D">
          <van-dropdown-item v-model="value" :options="option" />
        </van-dropdown-menu>
      </template>
    </van-nav-bar>
  
      <div class="subject-test__tab">
        <van-tabs
          line-width="24px"
          line-height="4px"
          scrollspy
          v-model:active="active"
        >
          <van-tab title="全部"></van-tab>
          <van-tab title="生产管理"></van-tab>
          <van-tab title="企管原理"></van-tab>
          <van-tab title="每周答题"></van-tab>
          <van-tab title="经济法"></van-tab>
          <van-tab title="生产管理"></van-tab>
          <van-tab title="企管原理"></van-tab>
          <van-tab title="每周答题"></van-tab>
          <van-tab title="经济法"></van-tab>
        </van-tabs>
      </div>
    </van-sticky>
    <div class="subject-test__content">
      <div class="img-card" v-for="i in 19" :key="i">
        <img src="@/assets/images/login.png" />
        <div class="img-card__right">
          <div class="img-card__title">
            <span class="tag">微课</span>
            <span class="title">历经中外合资企业、国营股份企 </span>
          </div>
          <div class="img-card__center">
            <div>
              <span>50</span>
              金币
            </div>
            <div>
              <span>20</span>
              学分
            </div>
          </div>
          <div class="img-card__footer">
            <div class="img-card__learn">已学习<span>75%</span></div>
            <div class="img-card__btn">去评价</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script name="SubjectTest" setup>
import { ref } from "vue";
const value = ref(0);
const active = ref(0);
const option = [
  { text: "全部考试", value: 0 },
  { text: "新款商品", value: 1 },
  { text: "活动商品", value: 2 },
];
</script>
<style lang="scss" scoped>
.subject-test {
  &__tab {
    background-color: #fff;
  }
  &__content {
    padding: 12px 16px;
  }

  .img-card {
    background-color: #fff;
    padding: 14px 16px;
    display: flex;
    border-radius: 4px;
    margin-bottom: 12px;
    img {
      width: 110px;
      height: 90px;
      border-radius: 4px;
    }
    &__right {
      flex: 1;
      padding-left: 10px;
    }
    &__title {
      .tag {
        float: left;
        text-align: center;
        line-height: 18px;
        margin-right: 10px;
        width: 32px;
        height: 18px;
        background: #d8f3e5;
        border-radius: 2px;
        font-size: 12px;
        font-family: PingFangSC, PingFang SC;
        font-weight: 400;
        color: #00ad6f;
      }
      .title {
        font-size: 16px;
        font-family: PingFangSC, PingFang SC;
        font-weight: 500;
        color: #272b2d;
        line-height: 22px;
      }
    }
    &__center {
      padding: 4px 0;
      display: flex;
      align-items: center;
      font-size: 12px;
      font-family: PingFangSC, PingFang SC;
      font-weight: 400;
      color: #676b6b;
      div {
        margin-right: 6px;
      }
      span {
        font-size: 12px;
        font-family: PingFangSC, PingFang SC;
        font-weight: 400;
        color: #ffac24;
      }
    }
    &__footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    &__learn {
      font-size: 12px;
      font-family: PingFangSC, PingFang SC;
      font-weight: 400;
      color: #676b6b;
      span {
        font-size: 12px;
        font-family: PingFangSC, PingFang SC;
        font-weight: 400;
        color: #ffac24;
        padding-left: 4px;
      }
    }
    &__btn {
      width: 60px;
      height: 20px;
      border-radius: 16px;
      border: 1px solid #00c37d;
      font-size: 12px;
      font-family: PingFangSC, PingFang SC;
      font-weight: 400;
      color: #00ad6f;
      display: flex;
      align-items: center;
      justify-content: center;
    }
  }
}
</style>